package com.example.demo.game;

import com.example.demo.entity.User;
import com.example.demo.runner.code.RunnerMessage;

import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;

/**
 * describe behaviour of a game manager
 */
public interface GameMgrInterface {
    /**
     * step into next state
     *
     * @param actions agent actions(commands)
     * @return state after updating the game
     * @throws Exception
     */
    public String step(Map<User, String> actions) throws Exception;

    /**
     * rule of parsing actions from raw input words
     *
     * @param user user who gave the action
     * @param raw  input queue
     * @return
     */
    public String parseAction(User user, BlockingQueue<RunnerMessage> raw);


    public Map getCanvas();

    /**
     * get current state string
     *
     * @return state string
     */
    public String getState();

    /**
     * check whether the game is over
     *
     * @return true if game over
     */
    public boolean isDone();

    /**
     * user list
     *
     * @return a unique list consists of involved users
     */
    public List<User> getUsers();
}

